{% extends 'base.html' %}
{% block title%} SemRate - Editing category: {{category.name}} {% endblock %}

{% block content %}

<h2> {{user_profile.username}} </h2>


<img style='width: 130px; height: 100px;' src='/site_media/{{user_profile.username}}.jpg'>

{% if user.is_authenticated %}

{% if is_owner %}

<a href="/accounts/password/change/">Change Password</a>
{% else %}
	{% if is_following %}
	You are following {{user_profile.username}}. <a href="/unfollow/{{user_profile.username}}">Unfollow</a>
	{% else %}
	<a href="/follow/{{user_profile.username}}">Follow {{user_profile.username}}</a>
	{% endif %}
{% endif %}

{% endif %} <!-- end of user authenticated -->
<br/>
<br>

Number of tags: {{tagcount}} <br/>

<br/>
<br/>
<p>
{% if following_list %}
	Following:
	{% for person in following_list %}
		<a href="/user/{{person.user.username}}">{{person.user.username}}</a> &nbsp
	{% endfor %}
{% else %}
	{{ user_profile.username}} is not following anyone.
{% endif %}
</p>

<p>
{% if follower_list %}
        Followed by:
        {% for person in follower_list %}
                <a href="/user/{{person.user.username}}">{{person.user.username}}</a> &nbsp
        {% endfor %}
{% else %}
        {{ user_profile.username}} is not followed by anyone.
{% endif %}
</p>



<p>
{% if products %}
<h3>{{user_profile.username}} has rated following products:</h3>
<table>

{% for pair in products %}
<tr>
  <td>
	<a class='discrete_link' href='/products{{pair.product.slug}}'> {{pair.product.name}} </a>
	<span style='white-space: nowrap; font-size: 8pt;'>({{pair.product.category}})</span>
  </d>
<tr>

{% endfor %}

</table>
{% else %}
{{user_profile.username}} has not rated any products yet.
{% endif %}
</p>

{% endblock %}
